import { get, postJson } from '../../http.ts';

export interface UserInfo{
  id: string
  account: string
  nickname: string
  roles: string
  auths: string
}

export async function loginUser(email: string, password: string) {
  const data = { "email": email, "password": password };
  return postJson('/api/auth/login', data);
}

export async function registerUser(userData: any) {
  const data = { "email": userData.email, "password": userData.password };
  return postJson('/api/auth/register', data);
}

export async function getCurrentUser() {
  return get('/workbench/guest/me');
}